package com.mdd.front.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.common.core.WxResult;
import com.mdd.front.validate.commons.PageValidate;
import com.mdd.front.validate.order.OrderCreateValidate;
import com.mdd.front.vo.order.OrderVo;
import com.mdd.front.vo.order.WxPayCallbackVo;
import org.springframework.http.HttpHeaders;

import javax.servlet.http.HttpServletRequest;

/**
 * @author shenjian
 * @createTime 2023年02月20日 23:01:00
 */
public interface IOrderService {

    /**
     * 创建订单
     * @param userId
     * @param createValidate
     */
    void createOrder(OrderCreateValidate createValidate, Integer userId);

    /**
     * 查询订单预支付
     * @param orderNo
     * @return
     */
    AjaxResult<Object> queryWxPrePayId(String orderNo);

    /**
     * 支付回调
     *
     * @param jsonObject
     * @param headers
     * @return
     */
    WxResult payCallback(JSONObject jsonObject, HttpHeaders headers);

    /**
     * 查询个人订单
     * @param pageValidate
     * @param status
     * @return
     */
    PageResult<OrderVo> searchOrderList(PageValidate pageValidate, Integer status);

    /**
     * 查询订单
     * @param orderId
     * @return
     */
    OrderVo findOrderById(Integer orderId);

    /**
     * 申请退款
     * @param orderId
     * @return
     */
    void applyRefund(Integer orderId);

    /**
     * 退款回调
     * @param jsonObject
     * @param headers
     * @return
     */
    WxResult refundCallback(JSONObject jsonObject, HttpHeaders headers);

    /**
     * 查询支付回调
     * @param orderNo
     */
    void pullWxPay(String orderNo);
}
